home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMIGA-CD 2
/
Amiga-CD - Volume 2.iso
/
gepackte_disketten
/
1994
/
08_94_5.dms
/
08_94_5.adf
/
term-4.0-Source.lha
/
termGlobal.h
< prev
next >
Wrap
Text File
|
1994-07-08
|
36KB
|
1,396 lines
/*
** termGlobal.h
**
** Global data structure definitions
**
** Copyright © 1990-1994 by Olaf `Olsen' Barthel
** All Rights Reserved
*/
/* Jump table entry. */
typedef BYTE (* JUMP)(UBYTE Char);
/* Pointer to function returning nothing. */
typedef VOID (* VPTR)();
/* Menu item codes. */
enum { MEN_SAVE_AS_PICTURE=1,MEN_SAVE_AS_TEXT,MEN_PRINT_SCREEN,MEN_PRINT_CLIP,MEN_CAPTURE_TO_FILE,
MEN_CAPTURE_TO_PRINTER,MEN_ICONIFY,MEN_ABOUT,MEN_QUIT,
MEN_COPY,MEN_PASTE,MEN_CLEAR,
MEN_EXECUTE_DOS_COMMAND,MEN_EXECUTE_REXX_COMMAND,MEN_RECORD,MEN_RECORD_LINE,
MEN_EDIT_TRAPS,MEN_DISABLE_TRAPS,
MEN_PHONEBOOK,MEN_REDIAL,MEN_DIAL_NUMBER,MEN_SEND_BREAK,
MEN_HANG_UP,MEN_WAIT,MEN_FLUSH_BUFFER,MEN_RELEASE_DEVICE,
MEN_UPLOAD_ASCII,MEN_DOWNLOAD_ASCII,MEN_UPLOAD_TEXT,MEN_DOWNLOAD_TEXT,MEN_EDIT_AND_UPLOAD_TEXT,
MEN_UPLOAD_BINARY,MEN_DOWNLOAD_BINARY,
MEN_CLEAR_BUFFER,MEN_DISPLAY_BUFFER,MEN_CLOSE_BUFFER,MEN_FREEZE_BUFFER,MEN_OPEN_BUFFER,
MEN_SAVE_BUFFER_AS,
MEN_CLEAR_SCREEN,MEN_RESET_FONT,MEN_RESET_STYLES,MEN_RESET_TERMINAL,
MEN_SERIAL,MEN_MODEM,MEN_SCREEN,MEN_TERMINAL,MEN_SET_EMULATION,MEN_CLIPBOARD,MEN_CAPTURE,MEN_COMMANDS,
MEN_MISC,MEN_PATH,MEN_TRANSFER_PROTOCOL,MEN_TRANSFER,MEN_TRANSLATION,MEN_MACROS,
MEN_CURSORKEYS,MEN_FAST_MACROS,MEN_HOTKEYS,MEN_SPEECH,MEN_SOUND,MEN_SET_CONSOLE,MEN_OPEN_SETTINGS,MEN_SAVE_SETTINGS,
MEN_SAVE_SETTINGS_AS,
MEN_STATUS_WINDOW,MEN_REVIEW_WINDOW,MEN_PACKET_WINDOW,MEN_FAST_MACROS_WINDOW,
MEN_UPLOAD_QUEUE_WINDOW
};
/* Menu item code limit, required by the quick dial menu. */
#define DIAL_MENU_LIMIT 1000
/* How many phone book entries will be stored in
* the quick dial menu.
*/
#define DIAL_MENU_MAX 50
/* Undefine the following symbols, the preferences header file
* will use the same names and the same values.
*/
#undef PARITY_NONE
#undef PARITY_EVEN
#undef PARITY_ODD
#undef PARITY_MARK
#undef PARITY_SPACE
/* Serial settings. */
enum { PARITY_NONE,PARITY_EVEN,PARITY_ODD,PARITY_MARK,PARITY_SPACE };
enum { HANDSHAKING_NONE,HANDSHAKING_RTSCTS,HANDSHAKING_RTSCTS_DSR };
enum { DUPLEX_FULL,DUPLEX_HALF };
enum { FLOW_NONE,FLOW_XON_XOFF };
/* Terminal settings. */
enum { CR_IGNORE,CR_ASCR,CR_ASCRLF };
enum { LF_IGNORE,LF_ASLF,LF_ASLFCR };
enum { EMULATION_ANSIVT100,EMULATION_ATOMIC,EMULATION_TTY,EMULATION_EXTERNAL,EMULATION_HEX };
enum { COLOUR_AMIGA,COLOUR_EIGHT,COLOUR_SIXTEEN,COLOUR_MONO };
/* Protocol types. */
enum { PROTOCOL_XMODEM,PROTOCOL_XMODEMCRC,PROTOCOL_YMODEM,PROTOCOL_ZMODEM };
/* Font types. */
enum { FONT_STANDARD,FONT_IBM,FONT_IBM_RAW };
/* Bell modes. */
enum { BELL_NONE, BELL_VISIBLE, BELL_AUDIBLE, BELL_BOTH, BELL_SYSTEM };
/* Data flow scanner indices. */
enum { SCAN_NOCARRIER, SCAN_ZMODEM, SCAN_CONNECT, SCAN_VOICE, SCAN_RING, SCAN_BUSY, SCAN_NODIALTONE,
SCAN_OK, SCAN_ERROR, SCAN_COUNT };
/* Status types. */
enum { STATUS_READY,STATUS_HOLDING,STATUS_DIALING,STATUS_UPLOAD,
STATUS_DOWNLOAD,STATUS_BREAKING,STATUS_HANGUP,
STATUS_RECORDING,STATUS_RECORDING_LINE
};
/* Sound types. */
enum { SOUND_BELL,SOUND_CONNECT,SOUND_DISCONNECT,SOUND_GOODTRANSFER,
SOUND_BADTRANSFER,SOUND_RING,SOUND_VOICE,SOUND_COUNT };
/* Settings types. */
enum { PREF_ALL,PREF_SERIAL,PREF_MODEM,PREF_COMMAND,PREF_SCREEN,
PREF_TERMINAL,PREF_PATH,PREF_MISC,PREF_CLIP,PREF_CAPTURE,
PREF_FILE,PREF_EMULATION,PREF_TRANSFER };
/* Status line modes. */
enum { STATUSLINE_DISABLED,STATUSLINE_STANDARD,STATUSLINE_COMPRESSED };
/* Capture filter modes. */
enum { FILTER_NONE,FILTER_ESCAPE,FILTER_CONTROL,FILTER_BOTH };
/* Scrolling modes. */
enum { SCROLL_JUMP,SCROLL_SMOOTH };
/* Auto-capture file creation. */
enum { AUTOCAPTURE_DATE_NAME,AUTOCAPTURE_DATE_INCLUDE };
/* Cursor and numeric keypad modes. */
enum { KEYMODE_STANDARD,KEYMODE_APPLICATION };
/* Font scales. */
enum { SCALE_NORMAL,SCALE_HALF };
enum { SCALE_ATTR_NORMAL,SCALE_ATTR_TOP2X,SCALE_ATTR_BOT2X,SCALE_ATTR_2X };
/* Character tables. */
enum { TABLE_ASCII,TABLE_GFX };
/* Transfer types. */
enum { TRANSFER_BINARY,TRANSFER_TEXT,TRANSFER_ASCII };
/* Translation table entry types. */
enum { TRANSLATE_SINGLE,TRANSLATE_STRING };
/* Upload panel actions. */
enum { UPLOAD_TEXT=1,UPLOAD_BINARY,UPLOAD_IGNORE,UPLOAD_ABORT,
UPLOAD_TEXT_FROM_LIST,UPLOAD_BINARY_FROM_LIST
};
/* Alert types. */
enum { ALERT_NONE,ALERT_BEEP,ALERT_SCREEN,ALERT_BEEP_SCREEN };
/* Online time display modes. */
enum { ONLINETIME_TIME,ONLINETIME_COST,ONLINETIME_BOTH };
/* Clipboard read errors. */
enum { CLIPERR_NONE,CLIPERR_NOTEXT,CLIPERR_IFF,CLIPERR_OPEN,CLIPERR_MEM };
/* What to print. */
enum { PRINT_SCREEN,PRINT_CLIP };
/* Dial command types. */
enum { DIAL_IGNORE,DIAL_LIST,DIAL_REDIAL };
/* Errors returned by ReconfigureSerial(). */
enum { RECONFIGURE_FAILURE,RECONFIGURE_NOCHANGE,RECONFIGURE_SUCCESS };
/* Operation codes for SetItem(). */
enum { SETITEM_SETCHECK,SETITEM_CLRCHECK,SETITEM_ON,SETITEM_OFF };
/* File identification actions. */
enum { IDENTIFY_IGNORE,IDENTIFY_FILETYPE,IDENTIFY_SOURCE };
/* Generic list types. */
enum { GLIST_UPLOAD,GLIST_DOWNLOAD,GLIST_DIAL,GLIST_WAIT,GLIST_TRAP,GLIST_COUNT };
/* Generic list add operations. */
enum { ADD_GLIST_BOTTOM,ADD_GLIST_TOP,ADD_GLIST_BEHIND,ADD_GLIST_BEFORE };
/* Transfer window gadgets. */
enum { GAD_TRANSFER_INFORMATION_LIST=1,
GAD_TRANSFER_PERCENT,GAD_TRANSFER_TIME,
GAD_TRANSFER_ABORT,GAD_TRANSFER_SKIP,
GAD_TRANSFER_PROTOCOL,GAD_TRANSFER_FILE,
GAD_TRANSFER_SIZE,GAD_TRANSFER_SECONDS,
GAD_TRANSFER_TOTALTIME,GAD_TRANSFER_ERRORS,
GAD_TRANSFER_ABORT_FILE
};
/* XPR options setting. */
enum { GAD_XPROPTIONS_USE=42,GAD_XPROPTIONS_CANCEL };
/* AmigaGuide help context. */
enum { CONTEXT_MAIN,CONTEXT_SERIAL,CONTEXT_MODEM,CONTEXT_SCREEN,
CONTEXT_TERMINAL,CONTEXT_CLIP,CONTEXT_CAPTURE,CONTEXT_COMMAND,
CONTEXT_MISC,CONTEXT_PATHS,CONTEXT_TRANSLATION,CONTEXT_MACROS,
CONTEXT_CURSOR,CONTEXT_FASTMACROS,CONTEXT_HOTKEYS,CONTEXT_SPEECH,
CONTEXT_EMULATION,CONTEXT_TRANSFER,CONTEXT_PHONEBOOK,CONTEXT_DATE,
CONTEXT_DAY,CONTEXT_IMPORT,CONTEXT_RATES,CONTEXT_TIME,
CONTEXT_COPY,CONTEXT_PASSWORDUSER,CONTEXT_DIAL,CONTEXT_PRINT,
CONTEXT_TEXTBUFFER,CONTEXT_PACKETWINDOW,CONTEXT_SOUND,
CONTEXT_LIBS,CONTEXT_ASCII,CONTEXT_PENS };
/* Character types. */
enum { CHAR_VANILLA,CHAR_CURSOR,CHAR_FUNCTION,CHAR_HELP,
CHAR_XON,CHAR_XOFF,CHAR_ENTER,CHAR_RETURN };
/* Review window positioning codes. */
enum { REVIEW_MOVE_TOP,REVIEW_MOVE_BOTTOM,REVIEW_MOVE_UP,REVIEW_MOVE_DOWN };
/* File type classes. */
enum { FILETYPE_NONE,FILETYPE_DIR,FILETYPE_FILE,FILETYPE_TEXT,FILETYPE_SOUND,
FILETYPE_PICTURE,FILETYPE_PREFS,FILETYPE_ARCHIVE,
FILETYPE_PROGRAM,
FILETYPE_COUNT };
/* Text pacing modes. */
enum { PACE_DIRECT,PACE_ECHO,PACE_ANYECHO,PACE_PROMPT,PACE_DELAY,PACE_KEYBOARD };
/* Where to open the buffer text window. */
enum { BUFFER_TOP,BUFFER_END };
/* Where to place the buffer screen horizontally. */
enum { SCREEN_LEFT,SCREEN_CENTRE,SCREEN_RIGHT };
/* Some raw key codes. */
#define HELP_CODE 95
#define RAMIGA_CODE 103
#define CURSOR_UP_CODE 76
#define CURSOR_DOWN_CODE 77
#define CURSOR_RIGHT_CODE 78
#define CURSOR_LEFT_CODE 79
#define F01_CODE 80
#define F02_CODE 81
#define F03_CODE 82
#define F04_CODE 83
#define F05_CODE 84
#define F06_CODE 85
#define F07_CODE 86
#define F08_CODE 87
#define F09_CODE 88
#define F10_CODE 89
/* A couple of useful minterms. */
#define MINTERM_ZERO 0
#define MINTERM_ONE ABC | ABNC | ANBC | ANBNC | NABC | NABNC | NANBC | NANBNC
#define MINTERM_COPY ABC | ABNC | NABC | NABNC
#define MINTERM_NOT_C ABNC | ANBNC | NABNC | NANBNC
#define MINTERM_B_AND_C ABC | NABC
#define MINTERM_NOT_B_AND_C ANBC | NANBC
#define MINTERM_B_OR_C ABC | ABNC | NABC | NABNC | ANBC | NANBC
/* Printer control bits. */
#define PRINT_SERIAL (1L << 0)
#define PRINT_MODEM (1L << 1)
#define PRINT_SCREEN (1L << 2)
#define PRINT_TERMINAL (1L << 3)
#define PRINT_USERNAME (1L << 4)
#define PRINT_COMMENT (1L << 5)
#define PRINT_SIZE (1L << 6)
#define PRINT_DATE (1L << 7)
#define PRINT_BITS (1L << 8)
/* Day of week flags. */
#define DAY_MONDAY (1L << 0)
#define DAY_TUESDAY (1L << 1)
#define DAY_WEDNESDAY (1L << 2)
#define DAY_THURSDAY (1L << 3)
#define DAY_FRIDAY (1L << 4)
#define DAY_SATURDAY (1L << 5)
#define DAY_SUNDAY (1L << 6)
/* These signal masks will make life a bit easier. */
#define SIG_WINDOW (1L << Window -> UserPort -> mp_SigBit)
#define SIG_SERIAL (ReadPort ? 1L << ReadPort -> mp_SigBit : NULL)
#define SIG_TIMER (1L << TimePort -> mp_SigBit)
#define SIG_QUEUE (SpecialQueue -> SigMask)
#define SIG_CHECK (1L << CheckBit)
#define SIG_WORKBENCH (1L << WorkbenchPort -> mp_SigBit)
#define SIG_REXX (1L << TermRexxPort -> mp_SigBit)
/* Task termination and handshake signal. Note: don't try this at
* home kids, we are all trained professionals here!
*/
#define SIG_KILL SIGBREAKF_CTRL_C
#define SIG_HANDSHAKE SIGF_SINGLE
/* Double-buffered file server command. */
#define SIG_COMMAND SIGBREAKF_CTRL_D
/* ARexx break signal. */
#define SIG_BREAK SIGBREAKF_CTRL_D
/* Hotkey reset command. */
#define SIG_RESET SIGBREAKF_CTRL_D
/* Skip dial entry. */
#define SIG_SKIP SIGBREAKF_CTRL_D
/* Status commands. */
#define SIG_BELL SIGBREAKF_CTRL_D
#define SIG_RESETTIME SIGBREAKF_CTRL_E
/* Buffer special signals. */
#define SIG_TOFRONT SIGBREAKF_CTRL_D
#define SIG_UPDATE SIGBREAKF_CTRL_E
#define SIG_MOVEUP SIGBREAKF_CTRL_F
/* Status display task. */
#define SIG_CLOSEWINDOW SIGBREAKF_CTRL_F
/* Upload queue. */
#define SIG_SHOW SIGBREAKF_CTRL_D
#define SIG_HIDE SIGBREAKF_CTRL_E
#define SIG_GOAWAY SIGBREAKF_CTRL_F
/* A port signal mask. */
#define PORTMASK(P) (1L << (((struct MsgPort *)(P)) -> mp_SigBit))
/* Replacements for CheckItem() and OnMenu()/OffMenu(). */
#define CheckItem(ID,Mode) SetItem(ID,Mode ? SETITEM_SETCHECK : SETITEM_CLRCHECK)
#define OnItem(ID) SetItem(ID,SETITEM_ON)
#define OffItem(ID) SetItem(ID,SETITEM_OFF)
/* A handy signal macro. */
#define ClrSignal(Signals) SetSignal(0,Signals)
/* Another neat macro. */
#define NumElements(s) (sizeof(s) / sizeof((s)[0]))
/* Definitions to access the line signal setting functions supported by
* some IO serial boards (namely the ASDG board).
*/
#define SIOCMD_SETCTRLLINES (CMD_NONSTD + 7)
#define SIOB_RTSB 0
#define SIOB_DTRB 1
#define SIOB_RTSF (1L << SIOB_RTSB)
#define SIOB_DTRF (1L << SIOB_DTRB)
/* Turn time of day into `compressed' format. */
#define DT_GET_TIME(Hour,Minute) ((Minute) / 10 + (Hour) * 6)
/* Vector offsets for the TimeDate structure. */
enum { DT_FIRST_UNIT,DT_NEXT_UNIT };
/* Multiply lines and columns with the current font size. */
#define MUL_X(x) OffsetXTable[x]
#define MUL_Y(y) OffsetYTable[y]
/* A handy and short alias. */
#define TICK (CHECKIT | MENUTOGGLE)
/* For now the maximum length of a path/file name. */
#define MAX_FILENAME_LENGTH 256
/* The maximum width of a line to be stored in the text buffer. */
#define BUFFER_LINE_MAX 255
/* User interface definitions. */
#define SZ_AutoWidth TAG_USER+2 /* Use default width? */
#define SZ_NewColumn TAG_USER+4 /* Start new column */
#define SZ_Lines TAG_USER+5 /* Number of lines in object */
/* Box information types. */
enum { BOX_LEFT,BOX_TOP,BOX_WIDTH,BOX_HEIGHT };
/* Status gadget properties. */
#define SGA_FullWidth (TAG_USER+42)
#define SGA_Mode (TAG_USER+43)
/* Sizing gadget sizes. */
#define SIZE_GADGET_WIDTH_HIGH 18
#define SIZE_GADGET_WIDTH_LOW 13
/* Some windows to be opened on the main screen. */
enum { WINDOW_PACKET,WINDOW_STATUS,WINDOW_FILE,
WINDOW_REVIEW,WINDOW_FAST,WINDOW_FONT,
WINDOW_SCREEN,WINDOW_PERF,
WINDOW_COUNT };
/* Window alignment information. */
#define WC_ALIGNLEFT (1<<0)
#define WC_ALIGNRIGHT (1<<1)
#define WC_ALIGNTOP (1<<2)
#define WC_ALIGNBOTTOM (1<<3)
#define WC_EXPANDWIDTH (1<<4)
#define WC_EXPANDHEIGHT (1<<5)
#define WC_ALIGNSIDE (1<<6)
#define WC_ALIGNBELOW (1<<7)
/* Trap management. */
struct TrapNode
{
struct Node Node;
LONG Count,
SequenceLen;
STRPTR Sequence,
Command;
};
/* Trap preferences, not much. */
struct TrapSettings
{
BYTE Enabled,
Pad;
};
/* Window alignment data. */
struct WindowInfo
{
UWORD ID;
UWORD WindowFlags;
LONG Left,
Top,
Width,
Height;
};
/* Special character treatment. */
struct SpecialKey
{
UBYTE Key;
BYTE (* Routine)(VOID);
};
/* Cursor backup data. */
struct CursorData
{
struct TextFont *CurrentFont;
WORD CursorX,
CursorY;
BYTE Charset;
BYTE CharMode[2];
BYTE Attributes;
BYTE FgPen,
BgPen;
UBYTE Style;
};
/* File transfer information. */
struct FileTransferNode
{
struct MinNode Node;
ULONG Size;
STRPTR Name;
};
struct FileTransferInfo
{
struct MinList FileList;
ULONG TotalSize;
LONG TotalFiles;
ULONG DoneSize;
LONG DoneFiles;
struct FileTransferNode *CurrentFile;
ULONG CurrentSize;
};
/* Global data link. */
struct TermPort
{
struct MsgPort ExecNode;
struct Window *TopWindow;
struct SignalSemaphore OpenSemaphore;
LONG ID,OpenCount,HoldIt;
LONG Reserved[5];
};
/* Buffer search support. */
struct SearchInfo
{
UBYTE Distance[256],
Pattern[256];
LONG FoundX,
FoundY;
WORD PatternWidth;
WORD Index;
BOOLEAN Forward,
IgnoreCase;
};
/* Support for optimized scrolling routines. */
struct ScrollLineInfo
{
UWORD Left,Right,Width,
ColourMask;
};
/* A dial list entry. */
struct PhoneNode
{
struct Node VanillaNode;
UBYTE LocalName[50];
struct PhoneEntry *Entry;
};
/* A Fast! macro list entry. */
struct MacroNode
{
struct MacroNode *mn_Succ; /* Modeled after the default Node. */
struct MacroNode *mn_Pred;
WORD mn_Pad; /* Included only for Node compatibility. */
UBYTE *mn_Macro; /* = ln_Name, title */
UBYTE *mn_Code; /* The execution code. */
};
/* Speech preferences. */
struct SpeechConfig
{
WORD Rate,
Pitch;
LONG Frequency;
BYTE Sex,
Volume,
Enabled,
Pad;
};
/* Sound preferences */
struct SoundConfig
{
UBYTE BellFile[MAX_FILENAME_LENGTH],
ConnectFile[MAX_FILENAME_LENGTH],
DisconnectFile[MAX_FILENAME_LENGTH],
GoodTransferFile[MAX_FILENAME_LENGTH],
BadTransferFile[MAX_FILENAME_LENGTH],
RingFile[MAX_FILENAME_LENGTH],
VoiceFile[MAX_FILENAME_LENGTH];
BYTE Preload,
Pad;
BYTE Volume,
Pad2;
};
/* Macro Preferences. */
struct MacroKeys
{
UBYTE Keys[4][10][256];
};
/* Cursor key preferences. */
struct CursorKeys
{
UBYTE Keys[4][4][256];
};
/* Translation table entry. */
struct TranslationEntry
{
STRPTR String; /* Corresponding code string. */
UBYTE Type; /* Table entry type. */
UBYTE Len; /* String length if any. */
UBYTE Extra; /* Saves space, don't need to allocate memory for this one. */
UBYTE Null; /* Terminating null. */
};
struct TranslationHeader
{
UBYTE Type; /* Table entry type. */
UBYTE Code; /* Table offset. */
UBYTE Len; /* Entry length. */
UBYTE Pad;
};
/* Buffer translation handle. */
struct TranslationHandle
{
STRPTR LocalBuffer;
LONG LocalLen;
STRPTR SourceBuffer;
LONG SourceLen;
STRPTR DestinationBuffer;
LONG DestinationLen;
struct TranslationEntry **Table;
};
/* term hotkey configuration. */
struct HotkeysOld
{
UBYTE termScreenToFront[256];
UBYTE BufferScreenToFront[256];
UBYTE SkipDialEntry[256];
BYTE CommodityPriority;
BYTE HotkeysEnabled;
ULONG Reserved[25];
};
struct Hotkeys
{
UBYTE termScreenToFront[256];
UBYTE BufferScreenToFront[256];
UBYTE SkipDialEntry[256];
BYTE CommodityPriority;
BYTE HotkeysEnabled;
ULONG Reserved[25];
UBYTE AbortARexx[256];
};
/* Time/date structure. */
struct TimeDate
{
LONG Count; /* Table size. */
WORD PayPerUnit[2], /* Pay for each unit. */
SecPerUnit[2]; /* Number of seconds each unit lasts. */
UBYTE Time, /* The time associated with this entry. */
Pad;
};
/* Time date header information. */
struct TimeDateHeader
{
UBYTE Comment[22]; /* Comment for this entry. */
BYTE Month, /* Month of year or -1 -> Day = bitmapped days of week. */
Day; /* Day of month or -1 -> standard settings. */
};
struct TimeDateNode
{
struct Node VanillaNode; /* Default node entry. */
UBYTE Buffer[30]; /* Name buffer. */
struct TimeDate *Table; /* Table of time/date entries. */
struct TimeDateHeader Header; /* Header information. */
};
struct TimeNode
{
struct Node VanillaNode; /* Default node entry. */
UBYTE Name[20]; /* Name string. */
UBYTE Time; /* The time for this entry. */
};
/* Serial settings. */
struct SerialSettings
{
ULONG BaudRate; /* Baud rate. */
ULONG BreakLength; /* Length of break signal in microseconds. */
ULONG SerialBufferSize; /* Size of serial read/write buffer. */
UBYTE SerialDevice[MAX_FILENAME_LENGTH];
/* Serial device name. */
LONG UnitNumber; /* Serial device unit number. */
BYTE BitsPerChar; /* Bits per character. */
BYTE Parity; /* Parity check mode. */
BYTE StopBits; /* Number of stop bits. */
BYTE HandshakingProtocol; /* Handshaking protocol (RTS/CTS, etc.). */
BYTE Duplex; /* Full- or half-duplex? */
BYTE xONxOFF; /* xON/xOFF handshaking enabled? */
BYTE HighSpeed; /* Radboogie? */
BYTE Shared; /* Shared device access? */
BYTE StripBit8; /* Strip high-order bit? */
BYTE CheckCarrier; /* Track the carrier signal? */
BYTE PassThrough; /* Pass xON/xOFF characters through to modem? */
BYTE UseOwnDevUnit; /* Enable OwnDevUnit.library? */
ULONG Quantum; /* Buffer read quantum. */
BYTE IgnoreCarrier; /* Ignore carrier signal. */
BYTE UseNet; /* Use DNet-ID. */
UWORD NetID; /* The DNet-ID to use. */
};
/* Modem settings. */
struct ModemSettings
{
UBYTE ModemInit[80]; /* Modem init string. */
UBYTE ModemExit[80]; /* Modem exit string. */
UBYTE ModemHangup[80]; /* Modem hangup string. */
UBYTE DialPrefix[80]; /* Dial command prefix. */
UBYTE DialSuffix[80]; /* Dial command suffix. */
UBYTE NoCarrier[16]; /* `No carrier' string. */
UBYTE NoDialTone[16]; /* `No dialtone' string. */
UBYTE Connect[16]; /* `Connect' string. */
UBYTE Voice[16]; /* `Voice' string. */
UBYTE Ring[16]; /* `Ring' string. */
UBYTE Busy[16]; /* `Busy' string. */
LONG RedialDelay; /* Length of redial delay. */
LONG DialRetries; /* Number of dial retries. */
LONG DialTimeout; /* Length of dial timeout. */
BYTE ConnectAutoBaud; /* Use baud rate returned by modem? */
BYTE DropDTR; /* Drop the DTR signal on hangup? */
BYTE RedialAfterHangup; /* Redial list after hangup? */
BYTE Pad;
UBYTE Ok[16]; /* `Ok' string. */
UBYTE Error[16]; /* `Error' string. */
BYTE NoCarrierIsBusy; /* Treat `NO CARRIER' as `BUSY' signal? */
BYTE AbortHangsUp; /* Dialer `Abort' sends hangup string? */
WORD ConnectLimit; /* Connection limit. */
UBYTE ConnectLimitMacro[MAX_FILENAME_LENGTH]; /* Macro to be executed when limit is reached. */
LONG TimeToConnect; /* Number of seconds to pass between modem picking up
* the line and issuing the `CONNECT' message.
*/
};
/* Command settings. */
struct CommandSettings
{
UBYTE StartupMacro[256]; /* Startup macro. */
UBYTE LogoffMacro[256]; /* Macro executed after carrier has dropped or hung up. */
UBYTE UploadMacro[256]; /* Macro to execute after a successful upload. */
UBYTE DownloadMacro[256]; /* Macro to execute after a successful download. */
UBYTE LoginMacro[256]; /* Login macro, complements the logoff macro. */
};
/* Screen settings. */
struct ScreenSettings
{
ULONG DisplayMode; /* Screen display mode. */
WORD ColourMode; /* The terminal colour mode. */
UWORD Colours[16]; /* Colour palette. */
UBYTE FontName[MAX_FILENAME_LENGTH]; /* Default user interface font. */
WORD FontHeight; /* Default user interface font height. */
BYTE MakeScreenPublic; /* Are we to make our screen public? */
BYTE ShanghaiWindows; /* Are we to `shanghai' windows? */
BYTE Blinking; /* Screen blinking enabled? */
BYTE FasterLayout; /* Faster screen layout? */
BYTE TitleBar; /* Is the screen title bar enabled? */
BYTE StatusLine; /* Which mode is the status line in? */
BYTE UseWorkbench; /* Use the Workbench screen for the terminal window? */
UBYTE PubScreenName[MAXPUBSCREENNAME + 1]; /* Name of public screen to open window upon. */
BYTE TimeMode; /* Online time/fee display. */
BYTE Depth; /* Screen depth if any, 0 = don't bother. */
BYTE UsePens; /* Use special screen pens? */
BYTE PenColourMode; /* For which colour mode was the pen array built? */
UWORD PenArray[16]; /* Pen index array. */
ULONG DisplayWidth, /* Screen width. */
DisplayHeight; /* Screen height. */
UWORD OverscanType; /* Screen overscan type. */
BYTE ShareScreen; /* Don't open a backdrop window, share pens. */
BYTE SplitStatus; /* Split the status line from the main window. */
};
/* Terminal settings. */
struct TerminalSettings
{
BYTE BellMode; /* The bell mode. */
BYTE AlertMode; /* The user alert mode. */
BYTE EmulationMode; /* The terminal emulation mode. */
BYTE FontMode; /* The font mode. */
BYTE SendCR; /* Standard translations. */
BYTE SendLF;
BYTE ReceiveCR;
BYTE ReceiveLF;
UWORD NumColumns, /* Size of the terminal window. */
NumLines;
UBYTE KeyMapFileName[MAX_FILENAME_LENGTH]; /* Name of custom keymap file. */
UBYTE EmulationFileName[MAX_FILENAME_LENGTH]; /* External emulation file name. */
UBYTE BeepFileName[MAX_FILENAME_LENGTH]; /* Name of the custom beep sound file. */
UBYTE TextFontName[MAX_FILENAME_LENGTH]; /* Terminal text font name. */
WORD TextFontHeight; /* Terminal text font height. */
BYTE UseTerminalTask; /* Enable the terminal emulation process. */
BYTE Pad;
UBYTE IBMFontName[MAX_FILENAME_LENGTH]; /* Terminal text font name. */
WORD IBMFontHeight; /* Terminal text font height. */
};
/* Path settings. */
struct PathSettings
{
UBYTE ASCIIUploadPath[MAX_FILENAME_LENGTH]; /* Default ASCII upload file path. */
UBYTE ASCIIDownloadPath[MAX_FILENAME_LENGTH]; /* Default ASCII download file path. */
UBYTE TextUploadPath[MAX_FILENAME_LENGTH]; /* Default text upload file path. */
UBYTE TextDownloadPath[MAX_FILENAME_LENGTH]; /* Default text download file path. */
UBYTE BinaryUploadPath[MAX_FILENAME_LENGTH]; /* Default binary data upload file path. */
UBYTE BinaryDownloadPath[MAX_FILENAME_LENGTH]; /* Default binary data download file path. */
UBYTE DefaultStorage[MAX_FILENAME_LENGTH]; /* Default configuration storage path. */
UBYTE Editor[MAX_FILENAME_LENGTH]; /* Text file editor to use. */
UBYTE HelpFile[MAX_FILENAME_LENGTH]; /* Help text file. */
};
/* Miscellaneous settings. */
struct MiscSettings
{
BYTE Priority; /* Program priority. */
BYTE BackupConfig; /* Save the configuration between calls? */
BYTE OpenFastMacroPanel; /* Open the fast! macro panel? */
BYTE ReleaseDevice; /* Release serial device when iconified? */
BYTE TransferServer; /* Enable data transfer server? */
BYTE EmulationServer; /* Enable terminal emulation server? */
BYTE OverridePath; /* Override the protocol transfer path? */
BYTE AutoUpload; /* Enable the auto-upload panel? */
BYTE SetArchivedBit; /* Set the archived bit for files sent? */
BYTE IdentifyFiles; /* Try to identify files after download? */
BYTE TransferIcons; /* Transfer files along with their icons? */
BYTE CreateIcons; /* Create icons for files saved? */
BYTE SimpleIO; /* Use simple file I/O? */
BYTE PerfMeter; /* Transfer performance meter enabled? */
LONG IOBufferSize; /* Size of the asynchronous I/O buffer. */
};
/* Clipboard settings. */
struct ClipSettings
{
WORD ClipboardUnit; /* Clipboard unit to use. */
WORD LineDelay, /* Insert line delay. */
CharDelay; /* Insert character delay. */
UBYTE InsertPrefix[80]; /* Line insertion prefix. */
UBYTE InsertSuffix[80]; /* Line insertion suffix. */
UBYTE LinePrompt[256]; /* Line wait prompt. */
WORD SendTimeout; /* Line send timeout. */
UBYTE PacingMode; /* Text pacing mode. */
BYTE Pad;
};
/* Capture and logfile settings. */
struct CaptureSettings
{
BYTE LogActions; /* Create logfile? */
BYTE LogCall; /* Create callinfo-compatible logfile? */
UBYTE LogFileName[MAX_FILENAME_LENGTH]; /* Default logfile name. */
LONG MaxBufferSize; /* Maximum text buffer size. */
BYTE BufferEnabled; /* Is the text buffer enabled? */
BYTE ConnectAutoCapture; /* Open capture file on logon? */
BYTE CaptureFilterMode; /* The capture filter mode. */
UBYTE CapturePath[MAX_FILENAME_LENGTH]; /* The default path for capture files. */
UBYTE CallLogFileName[MAX_FILENAME_LENGTH]; /* Name of the call log file. */
UBYTE BufferPath[MAX_FILENAME_LENGTH]; /* Text buffer save path. */
BYTE AutoCaptureDate; /* Where to include the creation date? */
UBYTE SearchHistory;
BYTE OpenBufferWindow; /* Where to open the buffer window. */
BYTE OpenBufferScreen; /* Where to open the buffer screen. */
BYTE BufferScreenPosition; /* Where to place the buffer screen (horizontal) */
UBYTE BufferWidth; /* How long each line in the buffer should be. */
BYTE RememberBufferWindow; /* Remember buffer window context? */
BYTE RememberBufferScreen; /* Remember buffer screen context? */
ULONG BufferScreenMode; /* Screen display mode for buffer screen. */
};
/* File settings. */
struct FileSettings
{
UBYTE ProtocolFileName[MAX_FILENAME_LENGTH]; /* Transfer protocol file name. */
UBYTE TranslationFileName[MAX_FILENAME_LENGTH]; /* Character translation file name. */
UBYTE MacroFileName[MAX_FILENAME_LENGTH]; /* Keyboard macro file name. */
UBYTE CursorFileName[MAX_FILENAME_LENGTH]; /* Cursor key file name. */
UBYTE FastMacroFileName[MAX_FILENAME_LENGTH]; /* Fast macro file name. */
};
/* Emulation settings. */
struct EmulationSettings
{
BYTE CursorMode; /* Are the cursor keys switched to application mode? */
BYTE NumericMode; /* Is the numeric keypad switched to application mode? */
BYTE CursorWrap; /* Is cursor position wrapping enabled? */
BYTE LineWrap; /* Is character line wrapping enabled? */
BYTE InsertMode; /* Is the character insertion mode enabled? */
BYTE NewLineMode; /* Is the newline mode enabled? */
BYTE FontScale; /* Which font scale is enabled? */
BYTE ScrollMode; /* Is smooth scrolling enabled? */
BYTE DestructiveBackspace; /* Backspace erases characters? */
BYTE SwapBSDelete; /* DEL and BS keys are swapped? */
BYTE PrinterEnabled; /* Printer commands enabled? */
BYTE CLSResetsCursor; /* Clear screen command resets cursor position? */
UBYTE AnswerBack[80]; /* Answer-back message. */
BYTE KeysLocked; /* Numeric keypad mode locked? */
UBYTE MaxScroll; /* Maximum number of lines to prescroll. */
UBYTE MaxJump; /* Maximum number of lines to scroll in one jump. */
BYTE CursorLocked; /* Cursor keys locked? */
BYTE FontLocked; /* Font size locked? */
BYTE Pad;
};
/* File transfer library settings. */
struct TransferSettings
{
UBYTE DefaultLibrary[MAX_FILENAME_LENGTH],
ASCIIUploadLibrary[MAX_FILENAME_LENGTH],
ASCIIDownloadLibrary[MAX_FILENAME_LENGTH],
TextUploadLibrary[MAX_FILENAME_LENGTH],
TextDownloadLibrary[MAX_FILENAME_LENGTH],
BinaryUploadLibrary[MAX_FILENAME_LENGTH],
BinaryDownloadLibrary[MAX_FILENAME_LENGTH];
BYTE InternalASCIIUpload,
InternalASCIIDownload,
QuietTransfer,
MangleFileNames;
WORD LineDelay, /* Insert line delay. */
CharDelay; /* Insert character delay. */
UBYTE LinePrompt[256]; /* Line wait prompt. */
WORD SendTimeout; /* Line send timeout. */
UBYTE PacingMode; /* Text pacing mode. */
BYTE StripBit8; /* Strip high order bit. */
BYTE IgnoreDataPastArnold; /* Ignore data past terminator. */
UBYTE TerminatorChar; /* Terminator character. */
BYTE SendCR,
SendLF,
ReceiveCR,
ReceiveLF;
};
/* The new configuration settings. */
struct Configuration
{
struct SerialSettings *SerialConfig;
struct ModemSettings *ModemConfig;
struct ScreenSettings *ScreenConfig;
struct TerminalSettings *TerminalConfig;
struct EmulationSettings *EmulationConfig;
struct ClipSettings *ClipConfig;
struct CaptureSettings *CaptureConfig;
struct CommandSettings *CommandConfig;
struct MiscSettings *MiscConfig;
struct PathSettings *PathConfig;
struct FileSettings *FileConfig;
struct TransferSettings *TransferConfig;
};
/* Phonebook entry header. */
struct PhoneHeader
{
UBYTE Name[40], /* BBS name. */
Number[100], /* Phone number. */
Comment[100]; /* Comment. */
UBYTE UserName[100], /* User name for this BSS. */
Password[100]; /* Password for user name. */
BYTE QuickMenu; /* This entry appears in the quick dial menu? */
BYTE Pad;
};
/* A phonebook entry. */
struct PhoneEntry
{
struct PhoneNode *Node;
struct MinList TimeDateList;
LONG Count;
struct PhoneHeader *Header;
struct Configuration *Config;
};
/* A text box for several lines of text. */
struct TextBox
{
struct TextBox *NextBox; /* Next box in chain. */
LONG Left,Top, /* Position and size. */
Width,Height;
LONG LineWidth, /* Line width in pixels. */
LineHeight; /* Line height in pixels. */
LONG NumChars, /* Number of chars per line. */
NumLines; /* Number of lines. */
STRPTR *Title, /* Line titles. */
*Text; /* Line texts. */
LONG TitleFgPen,
TitleBgPen,
TextPen;
};
/* Block marker structure. */
struct BlockMarker
{
/* The object to manipulate. */
APTR Object;
/* Selection and unselection routines. */
VOID (* Select)(struct BlockMarker *Marker,LONG Left,LONG Top,LONG Width,LONG Height);
VOID (* Unselect)(struct BlockMarker *Marker,LONG Left,LONG Top,LONG Width,LONG Height);
/* Origin anchor point. */
LONG OriginX,
OriginY;
/* First and last selected line. */
LONG FirstLine,
LastLine;
/* First and last selected column. */
LONG FirstColumn,
LastColumn;
/* Top of display window, lines in the buffer and size of
* the display window.
*/
LONG Top,
Lines,
Width,
Height;
/* Canvas left and top edge. */
LONG LeftEdge,
TopEdge;
/* Last mouse position. */
LONG LastX,
LastY;
/* Single character dimensions. */
LONG TextFontWidth,
TextFontHeight;
/* Plane write mask. */
UBYTE WriteMask;
};
/* Global data flow <-> term interface. */
struct FlowInfo
{
BYTE Changed;
BYTE NoCarrier,
ZModemUpload;
BYTE Connect,
Voice,
Ring,
Busy,
NoDialTone,
Ok,
Error;
};
/* A scan sequence, somewhat similar to the FlowInfo structure. */
struct WaitNode
{
struct Node Node;
LONG Count; /* Number of characters matched. */
STRPTR Response; /* Immediate response. */
LONG ResponseLen; /* Length of immediate response string. */
};
struct DialNode
{
struct Node Node;
struct PhoneEntry *Entry;
};
/* A list as employed by the ARexx interface. */
struct GenericList
{
struct MinList ListHeader;
struct Node *ListNode;
LONG ListCount;
struct SignalSemaphore ListSemaphore;
};
/* Number of buffers to be used for buffered I/O. */
#define BUFFER_NUMBER 2
/* Auxiliary structure for buffered file I/O. */
struct Buffer
{
struct Message Message; /* Vanilla message header. */
BYTE SimpleIO; /* Real simple I/O? */
BYTE Pad;
BYTE Read; /* Last access has read data. */
BYTE Written; /* Last access has written data. */
LONG Action; /* Action to perform. */
LONG ActionData[2]; /* Seek and the like. */
LONG Result; /* Return value. */
BPTR FileHandle; /* Dos filehandle. */
UBYTE *Data; /* Data buffer. */
LONG BufLength; /* Length of data buffer. */
LONG BufPosition; /* Read/write pointer into buffer. */
LONG ReadBufFull; /* How many bytes are still to be read from the buffer? */
LONG WriteBufFull; /* How many bytes are still to be written to the buffer?*/
LONG RealPosition; /* Real position in file. */
LONG Cached; /* How many bytes in pre-load cache. */
UBYTE *DataBuffer[BUFFER_NUMBER]; /* The data buffers. */
LONG DataLength[BUFFER_NUMBER]; /* The lengths of the data buffers. */
WORD DataCount; /* Which buffer to use. */
BYTE WriteAccess; /* TRUE if a write file handle. */
BYTE LastActionFailed; /* TRUE if last action failed -> abort actions. */
struct Process *Child;
struct Process *Caller; /* Synchronization. */
BPTR DirLock;
struct InfoData __aligned InfoData;
BYTE Fresh; /* TRUE if no read/write access has taken place yet. */
BYTE Used; /* Did any access take place at all? */
struct DateStamp OpenDate; /* Date and time when file was opened. */
};
/* xpr serial bits. */
#define ST_PARTYON (1L << 0)
#define ST_PARTYODD (1L << 1)
#define ST_7WIRE (1L << 2)
#define ST_QBREAK (1L << 3)
#define ST_RADBOOGIE (1L << 4)
#define ST_SHARED (1L << 5)
#define ST_EOFMODE (1L << 6)
#define ST_XDISABLED (1L << 7)
#define ST_PARTYMARKON (1L << 8)
#define ST_PARTYMARK (1L << 9)
#define ST_2BITS (1L << 10)
#define ST_READ7 (1L << 11)
#define ST_WRITE7 (1L << 12)
/* Miscellaneous definitions. */
#define MILLION 1000000
/* Raster text line attributes. */
#define ATTR_UNDERLINE 1
#define ATTR_HIGHLIGHT 2
#define ATTR_BLINK 4
#define ATTR_INVERSE 8
/* Audio channels. */
#define LEFT0F 1
#define RIGHT0F 2
#define RIGHT1F 4
#define LEFT1F 8
/* Program revision and the approriate info structure. */
struct TermInfo
{
UWORD Version;
UWORD Revision;
};
/**********************************************************************/
// This defines the destructor data type
typedef VOID (* __stdargs DESTRUCTOR)(struct MsgItem *);
// A message queue handle
struct MsgQueue
{
struct SignalSemaphore Access; // Access semaphore
struct MinList MsgList; // This is where the queue items go
LONG QueueSize, // The length of the queue
MaxSize; // The maximum size of the queue, may be 0
struct MinList WaitList; // The list of tasks to wait for a wakeup signal
struct Task *SigTask; // The owner of this handle
ULONG SigMask; // The signal mask to wake up the owner
WORD SigBit; // The bit allocated for the mask, may be -1
BOOL Discard; // Discard or queue new items?
};
// A message item as used by the queue manager
struct MsgItem
{
struct MinNode Link; // List node link
DESTRUCTOR Destructor; // Destructor routine if any
};
// Your simple message item destructor setup
#define InitMsgItem(Item,Dest) (((struct MsgItem *)Item) -> Destructor = (Dest))
/**********************************************************************/
enum { DATAMSGTYPE_WRITE,DATAMSGTYPE_WRITECLIP,
DATAMSGTYPE_UPDATEREVIEW,DATAMSGTYPE_MOVEREVIEW,
DATAMSGTYPE_SERIALCOMMAND,DATAMSGTYPE_UPLOAD,
DATAMSGTYPE_COMMANDDONE,DATAMSGTYPE_MENU,
DATAMSGTYPE_RENDEZVOUS,DATAMSGTYPE_SERIALCOMMANDNOECHO
};
// An extension of the MsgItem data type
struct DataMsg
{
struct MsgItem Item; // The message item link
LONG Type; // Message type
UBYTE * Data; // Pointer to data area
LONG Size; // Size of data area
};
/**********************************************************************/
/* And now for something completely different... */
#include "termProtos.h"
#include "termData.h"
#include "termErrors.h"